﻿using System;
using System.Xml.Serialization;

namespace FlickrSL.Data
{
    public enum TokenPermissions
    {
        None = 0,
        Read,
        Write,
        Delete
    }

    [XmlType("auth")]
    public class AuthToken
    {
        [XmlElement("token")]
        public String Token { get; set; }

        [XmlElement("perms", Type = typeof(String))]
        public TokenPermissions Permissions { get; set; }

        [XmlElement("user")]
        public AuthenticatedUser User { get; set; }
    }

    [XmlType("user")]
    public class AuthenticatedUser
    {
        [XmlAttribute("nsid")]
        public String Id { get; set; }

        [XmlAttribute("username")]
        public String Username { get; set; }

        [XmlAttribute("fullname")]
        public String FullName { get; set; }
    }
}
